import 'dart:async';

import 'package:flutter/material.dart';
import '../widget/swiper.dart';

class PageViewSwiperTimer extends StatefulWidget {
  const PageViewSwiperTimer({super.key});

  @override
  State<PageViewSwiperTimer> createState() => _PageViewSwiperTimerState();
}

class _PageViewSwiperTimerState extends State<PageViewSwiperTimer> {
  int _currentIndex = 0;
  List<String> list = [];
  @override
  void initState() {
    super.initState();
    list = [
      'https://www.itying.com/images/flutter/1.png',
      'https://www.itying.com/images/flutter/2.png',
      'https://www.itying.com/images/flutter/3.png',
    ];

    //创建定时器
    // Timer.periodic(Duration(seconds: 3), (timer) {
    //   print('111');
    //   timer.cancel(); //取消定时器
    // });
  }

  @override
  //有操作点的轮播图
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('PageViewSwiperTimer演示')),
      body: ListView(children: [SwiperPage(list: list)]),
    );
  }
}
